    package com.example.a14113.android;

import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.app.AlertDialog.Builder;
import android.widget.*;

    public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Builder dialog = new android.app.AlertDialog.Builder(MainActivity.this);
                dialog.setIcon(android.R.drawable.ic_dialog_info);
                dialog.setTitle("欢迎");
                dialog.setMessage("欢迎使用本程序");
                dialog.setPositiveButton("肯定",new OnClickListener(){
                    public void onClick(DialogInterface a0,int a1){

                    }
                });
        dialog.setNegativeButton("否定",new OnClickListener(){
            public void onClick(DialogInterface a0,int a1){

            }
        });
        dialog.create();
        dialog.show();
    }
}
